<template>
  <div class="app-iframe-container">



    <!-- 表格内容 -->
    <el-row>
      <el-col :span="24">
        <el-table
          :data="data"
          border
          fit
          highlight-current-row
          style="width: 100%;">
          <el-table-column align="center" width="65" label="序列号">
            <template slot-scope="scope">
              {{ scope.$index+1 }}
            </template>
          </el-table-column>
          <el-table-column label="操作记录" prop="remark"/>
          <el-table-column label="操作时间" >
            <template slot-scope="scope">
              {{ scope.row.addDate | parseDateTime }}
            </template>
          </el-table-column>

        </el-table>
      </el-col>
    </el-row>
    <!-- /表格内容 -->
    <!-- 分页 -->
    <div class="pagination-container">
      <el-pagination v-show="queryParam.total>0" :current-page="queryParam.current" :page-sizes="appCommon.pageSize" :page-size="queryParam.size" :total="queryParam.total" background layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange"/>
    </div>
    <!-- /分页 -->
  </div>
</template>

<script>

import memberApi from '@/api/member/member'
export default {
  name: 'MemberHisList',
  props: {
    id: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      listLoading: false,
      currentRow: '',
      queryParam: {
        current: 1,
        size: 10,
        total: 0,
        memberId: this.id
      },
      form: {
        addDateRange: ''
      },
      data: []
    }
  },
  computed: {

  },
  mounted() {
    this.search()
  },
  methods: {

    // 处理每页大小改变
    handleSizeChange(val) {
      this.queryParam.size = val
      this.search()
    },
    // 处理页数改变
    handleCurrentChange(val) {
      this.queryParam.current = val
      this.search()
    },
    // 列表
    search() {

      memberApi.hisPage(this.queryParam).then(response => {
        if (response.data.code === 200) {
          var responseData = response.data.data
          this.data = responseData.records
          this.queryParam.current = responseData.current
          this.queryParam.total = responseData.total
          this.currentRow = ''
        } else {
          this.$message.error(response.data.msg)
        }
      })
    },
    // 重置分页条件，发起查询
    research() {
      this.queryParam.current = 1
      this.search()
    }
  }
}
</script>

<style scoped>
  .el-row {
    margin-bottom: 20px;
  }
  .danger{
    color:#F56C6C
  }
</style>
